package com.cf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cf.domain.pojo.Team;
import org.apache.ibatis.annotations.*;

public interface TeamMapper extends BaseMapper<Team> {
    @Update("update t_team set team_name = #{teamName}, coach = #{coach}, plan_url = #{plan}, video_url = #{video} where id = #{id}")
    int updateTeam(@Param("id") Long id, @Param("teamName") String teamName, @Param("coach") Integer coach, @Param("plan") String plan, @Param("video") String video);

    @Select("SELECT id,team_name,coach,plan_url,video_url FROM t_team WHERE user_id = #{userId}")
    @Results({
            @Result(property = "plan", column = "plan_url"),
            @Result(property = "video", column = "video_url")
    })
    Team getTeamByUserId(Long userId);
}
